qq<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function jing(n,j,d){
            let a = 0
            let zong = 0
            let num = 0
            while(zong<n){
                zong += j
                num ++
                if(zong + j > n){
                    a += j
                    document.write(`跳了${a}米`)
                    document.write(`${zong}次跳出`)
                    return 
                }else{
                    a += d
                    zong-=d
                }
            }
        }
        jing(8,3,2)
    </script>
</body>
</html>